package com.edee.bigday.auth.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class BigdayWebConfig implements WebMvcConfigurer {
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        /**
         * @GetMapping({"/","/login.html"})
         *     //使http://auth.bigday.com/和http://auth.bigday.com/login.html均跳转到login
         *     public String loginPage(){
         *         return "login";
         *     }
         */
        //仅GET方式的请求才能使用此种映射：
        //registry.addViewController("/login.html").setViewName("login");
        //registry.addViewController("/").setViewName("login");
        //上述配置注释，在com/edee/bigday/auth/controller/LoginController.java中增加新的处理逻辑。
        registry.addViewController("/reg.html").setViewName("reg");
    }
}
